package com.whj.apidriver.service.impl;

import com.whj.apidriver.remote.ServiceDriverUserClient;
import com.whj.apidriver.service.UserService;
import com.whj.internalcommon.dto.DriverCarBindingRelationship;
import com.whj.internalcommon.dto.DriverUser;
import com.whj.internalcommon.dto.DriverUserWorkStatus;
import com.whj.internalcommon.dto.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Auther: wanghaijun
 * @Date: 2023/1/12 - 01 - 12 - 13:53 
 * @Description: com.whj.apidriver.service.impl
 */

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private ServiceDriverUserClient serviceDriverUserClient;

    /**
     * 司机更新用户信息
     *
     * @param driverUser
     * @return
     */
    @Override
    public ResponseResult updateUser(DriverUser driverUser) {
        return serviceDriverUserClient.updateDriverUser(driverUser);
    }

    /**
     * 司机修改自己状态
     *
     * @param driverUserWorkStatus
     * @return
     */
    @Override
    public ResponseResult changeWorkStatus(DriverUserWorkStatus driverUserWorkStatus) {

        return serviceDriverUserClient.changeWorkStatus(driverUserWorkStatus);
    }

    /**
     * 根据司机id寻找车辆信息
     *
     * @param driverPhone
     * @return
     */
    @Override
    public ResponseResult<DriverCarBindingRelationship> findMessage(String driverPhone) {
        return serviceDriverUserClient.findMessage(driverPhone);
    }

    @Override
    public ResponseResult<DriverUserWorkStatus> getWorkStatus(Long driverId) {
        return serviceDriverUserClient.getWorkStatus(driverId);
    }
}
